package cn.ad.param;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/7/15.
 */
public class MediaReportQuery extends AbstractPagingSortParam{

    /**
     * 查询条件 广告位ID或者广告位名称
     */
    private String search;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date startTime;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date endTime;

    private Integer supplierId;

    public String getSearch() {
        return search;
    }

    public void setSearch(String search) {
        this.search = search;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        if(supplierId!=null){
            this.supplierId = supplierId;
        }else{
            this.supplierId=null;
        }
    }

    public Map<String,Object> getSearchMap(){
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("search", this.search);
        map.put("supplierId",this.supplierId);
        map.put("startTime", this.startTime);
        map.put("endTime",this.endTime);
        return map;
    }
}
